/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 顶部区域样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

header h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1rem;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: #3498db;
}

/* 主要内容区域 */
main {
    margin-top: 120px;
    padding: 2rem;
}

/* 轮播图样式 */
.carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto 3rem;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.carousel-container {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease;
}

.carousel-slide {
    flex: 0 0 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 1rem;
    text-align: center;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10;
}

.carousel-prev { left: 0; border-radius: 0 5px 5px 0; }
.carousel-next { right: 0; border-radius: 5px 0 0 5px; }

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(0,0,0,0.8);
}

/* 对话界面样式 */
.chat-interface {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    padding: 1rem;
}

.chat-history {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.welcome-message {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.chat-input {
    display: flex;
    gap: 1rem;
}

.chat-input input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.send-button {
    padding: 0.8rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.send-button:hover {
    background: #2980b9;
}

.privacy-notice {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.privacy-notice a {
    color: #3498db;
    text-decoration: none;
}

/* 底部区域样式 */
footer {
    background: #2c3e50;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.social-icon img {
    width: 25px;
    height: 25px;
    transition: transform 0.3s;
}

.social-icon:hover img {
    transform: scale(1.2);
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    nav ul {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .carousel-slide img {
        height: 300px;
    }

    .chat-interface {
        margin: 1rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-icon img {
        width: 22px;
        height: 22px;
    }
}

/* 通用section样式 */
.section {
    max-width: 1200px;
    margin: 0 auto 5rem;
    padding: 2rem;
}

.section h2 {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #3498db;
    margin: 1rem auto;
}

/* 首页部分样式 */
.intro-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.8;
}

.skills {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.skill-list {
    list-style: none;
    padding: 0;
}

.skill-list li {
    margin: 1rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.skill-list li::before {
    content: '▹';
    color: #3498db;
    position: absolute;
    left: 0;
}

/* 关于我部分样式 */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.about-text h3 {
    color: #2c3e50;
    margin: 1.5rem 0 1rem;
}

.about-text ul {
    list-style: none;
    padding-left: 1.5rem;
}

.about-text li {
    margin: 0.5rem 0;
}

/* 作品集部分样式 */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.portfolio-info {
    padding: 1.5rem;
}

.portfolio-info h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.project-link {
    display: inline-block;
    margin-top: 1rem;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.project-link:hover {
    text-decoration: underline;
}

/* 响应式设计补充 */
@media (max-width: 768px) {
    .section {
        padding: 1rem;
    }

    .intro-content,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .section h2 {
        font-size: 2rem;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 20px;
    width: 80%;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 30px;
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #000;
}

.modal-section {
    display: none;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.modal-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 4px;
}

.modal-text {
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 4px;
    margin-top: 20px;
}

.modal-text h3 {
    margin-bottom: 15px;
    color: #333;
}

.modal-text ul {
    list-style-type: disc;
    margin-left: 20px;
}

.modal-text li {
    margin-bottom: 8px;
}

/* 修改项目链接按钮样式 */
.project-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.project-link:hover {
    background-color: #555;
}

/* 添加到现有的 CSS 文件中 */
.message {
    margin: 10px;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
}

.user-message {
    background-color: #007bff;
    color: white;
    margin-left: auto;
}

.ai-message {
    background-color: #f8f9fa;
    color: #333;
    margin-right: auto;
}

.loading {
    background-color: #e9ecef;
    color: #666;
}

.chat-history {
    display: flex;
    flex-direction: column;
}

.message p {
    margin: 0;
    word-wrap: break-word;
} 